local s = os.getenv("OS")
if s == "Windows_NT" then
	p = ".\\Scripts\\"
	p2 = ".\\"
else
	p = "\\Program Files\\wmssystem\\Scripts\\"
	p2 = "\\Program Files\\wmssystem\\"
end

if s == "Windows_NT" then
		rootdir = ".\\"
	else
		rootdir = "\\Program Files\\wmssystem\\"
end

--m_package_path = package.path
--package.path = string.format("%s;%s?.lua",m_package_path,p,p)
package.path = p .. ";" .. p .. "?.lua" .. ";" .. p2 .. ";" .. p2 .. "?.lua"
package.cpath = p2 .. ";" .. p2 .. "?.dll"

-- Remove Death Lock
os.remove(rootdir .. "tmp\\death_lock.txt")
print("DBG:Death_Lock Removed.\n")

function Dispatcher(fname,methon,para)
	print("Dispatcher.lua loaded.\n")
	print("Loading GUI.EventHandler.Form." .. fname .. "\n");
	m = require("GUI.EventHandler.Form." .. fname)
	if m == false or m == true or m == nil then
		print("DBG:No module GUI.EventHandler.Form." .. fname .. " found!\n")
		return 1
	end
	r = m.Parse(methon,para)
	if r == nil then
		r = "nil"
	end
	print("DBG:Eventhandler exited with code " .. r .. "\n")

	return 0
end